Replacing the call of a block

How to replace an existing →call for a →block in the →graphical FBD-editor when dragging the block from the project explorer:

 

Step

Example: The used AND block is to be replaced by an OR block.

1

Expand the ST-object or the FBD-object in the project explorer.

Expand the folders IEC61131-1Bitstring and OR.

2

Point to the corresponding sub-level item.
(The sub-levels of the ST-objects and the sub-level of the FBD-object display an icon each to identify the declaration type.)

Point to the sub-level item OR.

3

Press and hold the primary mouse button while you are dragging the block into the opened FBD-editor.

 

4

Position the call over a call that is already set in the drawing field.

Position the OR block over the AND block.

5

Replace the existing call by releasing the primary mouse button.
The call is set for the new block, if it is possible in the context of the opened FBD-editor (see glossary items →program→function block and →function for more information). The "properties" of the replaced call (e.g. connected lines, negations) are used for the new call – as far as possible (see the following descriptions for details).

Press the ESC-key, if you do not want to position the element and abort the action.

Now the OR block is used.

(info) The replacing of a block is possible analogously, if the new call has been created by using the content assist.
(info) If you want to replace the call by a new call of the same block, best practice is to update the existing call (see "Updating existing calls for changed interfaces").

Behavior when replacing: Instance name is not used.

The instance name of the new function block is replaced instead of the instance name of the original block. However, the display settings of the original block is used. That means, if the instance name has been shown for the original block, the instance name will be displayed for the new function block as well.

Mind the following special cases:

  • If a variable of the original block is accessed in the drawing field, this access is not automatically updated to the name of the new block (see example 1). Observe that the access is not highlighted as faulty. The reason for this is that the variable of the original block still exists.

  • If a function block is replaced by a function, no instance name will be displayed for the function. Reason: Functions do not have an instance name (see example 2).

 

Example 1

Example 2

Original block

is replaced

with this new block.

Behavior when replacing: Properties are used.

Here an explanation using examples which properties of the replaced call (= original block) are usually used for the new call (= new block).

Different size of blocks

The size of the original block is used for the new block (see example 1). Exception: The new block is automatically enlarged so that all necessary in-/outputs are visible (see example 2).

 

Example 1

Example 2

Original block

is replaced

with this new block.

Connected lines

Linies are reattached to the new block. Mind the following results:

  • If type conflicts arise, they are highlighted by the faulty lines (see example 1).

  • If there is no in-/output at the new block where a line was connected to an in-/output of the original block, the line is deleted (see example 2).

 

Example 1

Example 2

Original block

is replaced

with this new block.

Other properties

Moreover, the new blocks uses all other settings that have been made for the original block in the drawing field.

Examples for such used settings: